package com.wisely.highlight_spring4.ch2.profile;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

/**
 * @ClassName ProfileConfig
 * @Package com.wisely.highlight_spring.ch2.profile
 * @Description TODO
 * @Author zjb
 * @Date 2018/7/20 12:01
 * @Version 1.0
 **/
@Configuration
public class ProfileConfig {
    @Bean
    //Profile为dev时实例化devDemoBean
    @Profile("dev")
    public DemoBean devDemoBean(){
        return new DemoBean("from development profile");
    }

    @Bean
    //Profile为prod时实例化prodDemoBean
    @Profile("prod")
    public  DemoBean prodDemoBean(){
        return new DemoBean("from production profile");
    }
}
